<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">
    <h:head>
        <title>Facelet Title</title>
    </h:head>
    <h:body>
        <ui:composition template="../Master/MasterPage.xhtml">
            <ui:define name="isa1">
                <h:outputText escape="false"  value="#{malbum_Index.message}"/>
                <div class="t-title">
                    <h3><img src="../Iconpage/master/form.png "/>&nbsp;ALBUM MANAGER</h3>
                    <div class="t-in">
                        Filter
                        <h:selectOneMenu class="commoboxIm" onchange="submit()" value="#{malbum_Index.idCategories}"
                                         valueChangeListener="#{malbum_Index.categoriesValuesChange}">
                            <f:selectItems value="#{malbum_Index.listCategories}"/>
                        </h:selectOneMenu>&nbsp;
                        <h:commandLink class="expoler-window" value="ADD NEW" action="#{malbum_Index.redirectadd}" />
                        <p:dataTable id="dataTable" filteredValue="#{malbum_Index.filterAlbum}" var="album" value="#{malbum_Index.listAlbum}"  
                                     paginator="true" rows="10"  
                                     paginatorTemplate="{CurrentPageReport}  
                                     {FirstPageLink} {PreviousPageLink} {PageLinks} 
                                     {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
                                     rowsPerPageTemplate="5,10,15,50">  
                            <p:column filterBy="#{album.albumName}" filterStyle="width:300px" filterMatchMode="contains">  
                                <f:facet name="header">  
                                    <h:outputText value="Name Disc" />  
                                </f:facet>  
                                <img src="../../#{album.albumImage}" width="50px" align="middle"/>&nbsp;
                                <h:commandLink id="ik" value="#{album.albumName}" 
                                               action="#{malbum_Index.setIDAlbum(album.albumID)}" 
                                               class="text-table-title" style="color:#333"/>
                            </p:column>  
                            <p:column>  
                                <f:facet name="header">  
                                    <h:outputText value="Price" />  
                                </f:facet>  
                                <h:outputText style="color: #e25d33;font-size: 13px; font-weight: 600; font-family: arial; line-height: 1.3em" value="$. #{album.albumPrice}" />  
                            </p:column>  
                            <p:column style="width: 100px">  
                                <f:facet name="header">  
                                    <h:outputText value="Date Create" />  
                                </f:facet>  
                                <h:outputText value="#{album.albumDateCreate}" />  
                            </p:column>  
                            <p:column>  
                                <f:facet name="header">  
                                    <h:outputText value="Option" />  
                                </f:facet>  
                                <a title="Comment" href="../../DetailsAlbum.xhtml?id=#{album.albumID}" target="blank"><img src="../Iconpage/icon-comments.png"/><span style="padding-right: 10px; color: #191919" title="Comment">#{malbum_Index.showcountComment(album.albumID)}</span></a>
                                <h:commandButton class="optionicon-#{album.albumStatus}" 
                                                 value="#{malbum_Index.returnStatus(album.albumStatus)}" 
                                                 id="btnOnOffAlbum" 
                                                 action="#{malbum_Index.btnOnOffAlbum_Click(album.albumID)}"/>&nbsp;| 
                                <h:commandButton  action="#{malbum_Index.setIDAlbum(album.albumID)}" value="edit" class="optionicon" />&nbsp;|
                                <h:commandButton class="optionicon" 
                                                 value="Remove"
                                                 onclick="javascript:return deleteconfirm();"/>
                            </p:column>  
                            <p:column style="width: 20px">  
                                <f:facet name="header">  
                                    <h:outputText value="Qtty" />  
                                </f:facet>  
                                <h:outputText value="#{album.quantity}" />  
                            </p:column>  
                        </p:dataTable>  
                    </div>
                </div>
            </ui:define>
        </ui:composition>
    </h:body>
</html>

